hysop.backend.host.python.operator.flowrate_correction module

class hysop.backend.host.python.operator.flowrate_correction.PythonFlowRateCorrection(velocity, vorticity, dt, flowrate, variables, absorption_start=None, implementation=None, **kwds)[source]

Bases: HostOperator

Update velocity field (solution of Poisson equation) in order to prescribe proper mean flow and ensure the desired inlet flowrate.

Flowrate is corrected from the current flowrate through the box input face (X=orgin, normal=(-1,0,0)) Velocity is corrected in X-direction from prescribed flowrate Velocity is corrected in Y and Z-direction from mean vorticity

Create the common attributes of all host operators.

All input and output variable topologies should be of kind Backend.HOST and share the same HostEnvironment.

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

discretize()[source]

By default, an operator discretize all its variables. For each input continuous field that is also an output field, input topology may be different from the output topology.

After this call, one can access self.input_discrete_fields and self.output_discrete_fields, which contains input and output dicretised fields mapped by continuous fields.

self.discrete_fields will be a tuple containing all input and output discrete fields.

Discrete tensor fields are built back from discretized scalar fields and are accessible from self.input_tensor_fields, self.output_tensor_fields and self.discrete_tensor_fields like their scalar counterpart.

get_field_requirements()[source]

Called just after handle_method(), ie self.method has been set. Field requirements are:

  1. required local and global transposition state, if any.

  2. required memory ordering (either C or Fortran)

Default is Backend.HOST, no min or max ghosts, MemoryOrdering.ANY and no specific default transposition state for each input and output variables.

classmethod supported_dimensions()[source]
classmethod supports_mpi()[source]

Return True if this operator was implemented to support multiple mpi processes.